﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Region.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!--#include virtual="include/Head.ascx"-->
    <script type="text/javascript" language="javascript">
        function doDelete(strID) {
            if (confirm('Bạn có thực sự muốn xóa')) {
                var vnpage = getUrlVars()['page_number'];
                if (vnpage)
                    window.location.href = "Region.aspx?action=delete&ID=" + strID + "&page_number=" + vnpage;
                else
                    window.location.href = "Region.aspx?action=delete&ID=" + strID;
            }
        }

        function getUrlVars() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        }
    </script>
    <style type="text/css">
        .groupheader
        {
            background: #efefef !important;
            text-transform: uppercase;
            text-align: center;
        }
        
        .groupheader td
        {
            text-align: center;
        }
    </style>
</head>
<body>
    <%if ((Session["logined_id"] == null) && (int.Parse(Session["logined_id"].ToString()) <= 0))
          Response.Redirect("login.aspx"); %>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/Top.ascx"-->
        </div>
        <div id="main-content1">
            <div class="clear">
            </div>
            <div class="content-box" style="width: 40%">
                <div class="content-box-header">
                    <h3 style="cursor: s-resize;">
                        REGIONS
                    </h3>
                    <div class="clear">
                    </div>
                </div>
                <form id="frmEdit" runat="server" method="post">
                <asp:Repeater ID="rptData" runat="server">
                    <ItemTemplate>
                        <%-- <%# this.RenderGroup(Eval("GroupAreas") as string) %>--%>
                        <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                            <td>
                                <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                <asp:HiddenField ID="txtID" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "ID")%>'>
                                </asp:HiddenField>
                            </td>
                            <td>
                                <asp:TextBox ID="txtCode" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "Code") %>'
                                    Width="90%"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox ID="txtName" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "Name") %>'
                                    Width="90%"></asp:TextBox>
                            </td>
                            <td align="center">
                                <%# DataBinder.Eval(Container.DataItem, "Action")%>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <HeaderTemplate>
                        <table cellspacing="0" cellpadding="0" width="100%" border="0" class="adminlist">
                            <thead>
                                <tr>
                                    <th align="center" class="thheader" width="30px">
                                        Index
                                    </th>
                                    <th align="center" class="thheader" width="150px">
                                        Code
                                    </th>
                                    <th align="center" class="thheader">
                                        Name
                                    </th>
                                    <th>
                                        Action
                                    </th>
                                </tr>
                            </thead>
                    </HeaderTemplate>
                    <FooterTemplate>
                        </TABLE>
                    </FooterTemplate>
                </asp:Repeater>
                </tbody> </table>
                <div class="clear">
                </div>
                <div style="margin-top: 5px; width: 100%">
                    <asp:Button ID="btnSave" runat="server" Text="Update" class="button" OnClick="btnSave_Click" />
                </div>
                </form>
                <div class="clear">
                </div>
            </div>
            <div id="footer">
            </div>
        </div>
    </div>
</body>
</html>
